package com.EAIPClub.ClassesManager.mapper;

import com.api.POJO.ClassesManager.ClassesDataInfo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description :
 * @Author :
 * @Date : 2021/12/12
 */
@Mapper
@Repository
public interface ClassesDataInfoMapper {

    @Insert("INSERT INTO t_classes VALUES (null,'${info.uid}','${info.section}','${info.paragraph}','${info.classuid}')")
    Boolean addNewClassesDataInfo(@Param("info") ClassesDataInfo info);

    @Select("SELECT * FROM t_classes WHERE id= ${id}")
    ClassesDataInfo getClassesDataInfoByID(@Param("id") Integer ID);
    @Select("SELECT * FROM t_classes WHERE uid= '${uid}'")
    ClassesDataInfo getClassesDataInfoByUid(@Param("uid") String uid);
    @Select("SELECT * FROM t_classes WHERE classuid='${classuid}'")
    List<ClassesDataInfo> getClassesDataInfoByClassesUid(@Param("classuid") String classesUid);

    Boolean updateClassesDataInfoByID(Integer ID,ClassesDataInfo info);
    Boolean updateClassesDataInfoByUid(String uid,ClassesDataInfo info);

    Boolean deleteClassesDataInfoByID(Integer ID);
    @Delete("DELETE FROM t_classes WHERE uid = '${uid}'")
    Boolean deleteClassesDataInfoByUid(@Param("uid") String uid);

}
